import superr from '@/common/components/superr.js'
export default class loginConfig extends superr {
  labelWidth = 80
  options = {
    label: {
      type: 'label',
      vertical: true,
      position: 'center', //left,center,right
      default: '用户登录',
      style: { 'font-size': '20px', 'margin-bottom': '20px' },
    },
    name: {
      type: 'input',
      vertical: true,
      required: true,
      clearable: true,
      style: { 'margin-bottom': '20px' },
      placeholder: '请输入用户名',
      rule: [
        {
          required: true,
          validator: (rule, value, callback) => {
            if (isEmpty(value)) {
              callback(new Error('请输入用户名'))
            } else {
              callback()
            }
          },
        },
      ],
    },
    password: {
      type: 'input',
      vertical: true,
      required: true,
      clearable: true,
      password: true,
      style: { 'margin-bottom': '20px' },
      placeholder: '请输入密码',
      rule: [
        {
          required: true,
          validator: (rule, value, callback) => {
            if (isEmpty(value)) {
              callback(new Error('请输入密码'))
            } else {
              callback()
            }
          },
        },
      ],
    },
    button: {
      type: 'button',
      vertical: true,
      position: 'center', //left,center,right
      buttons: [
        {
          name: '登录',
          class: 'cpt_btn_blue',
          style: { width: '100%' },
          click: function (data) {
            data.other.vue.loginClick()
          },
        },
      ],
    },
  }
  constructor(data) {
    super(data)
  }
}
